home *** CD-ROM | disk | FTP | other *** search
- errmsg proc near
- jmp chk2
-
- ;----------------------------------------------------------
- ; constants and messages
-
- cr equ 13
- lf equ 10
- eos equ '$'
- err2_msg db '-File not found-',cr,lf,eos
- err3_msg db '-Path not found-',cr,lf,eos
- err4_msg db '-Too many open files (no handles left)-',cr,lf,eos
- err5_msg db '-Access denied-',cr,lf,eos
- err6_msg db '-Invalid handle-',cr,lf,eos
- err12_msg db '-Invalid access code-',cr,lf,eos
- err17_msg db '-Not same device-',cr,lf,eos
- err18_msg db '-No more files-',cr,lf,eos
- bad_err_msg db '-Unrecognized error code-',cr,lf,eos
-
- ;----------------------------------------------------------
- ; subroutines
-
- msg_out proc near
- ;DX has offset of message
- mov ah,9h ;Print string function call
- int 21h
- ret
- msg_out endp
-
- ;----------------------------------------------------------
- ; main code section
-
- chk2: cmp ax,2
- jne chk3
- mov dx,offset err2_msg
- call msg_out
- jmp errmsg_exit
- chk3: cmp ax,3
- jne chk4
- mov dx,offset err3_msg
- call msg_out
- jmp errmsg_exit
- chk4: cmp ax,4
- jne chk5
- mov dx,offset err4_msg
- call msg_out
- jmp errmsg_exit
- chk5: cmp ax,5
- jne chk6
- mov dx,offset err5_msg
- call msg_out
- jmp errmsg_exit
- chk6: cmp ax,6
- jne chk12
- mov dx,offset err6_msg
- call msg_out
- jmp errmsg_exit
- chk12: cmp ax,12
- jne chk17
- mov dx,offset err12_msg
- call msg_out
- jmp errmsg_exit
- chk17: cmp ax,17
- jne chk18
- mov dx,offset err17_msg
- call msg_out
- jmp errmsg_exit
- chk18: cmp ax,18
- jne bad_err
- mov dx,offset err18_msg
- call msg_out
- jmp errmsg_exit
- bad_err: mov dx,offset bad_err_msg
- call msg_out
- jmp errmsg_exit
-
- errmsg_exit:
- ret
-
- errmsg endp